package com.swf.common.xml;

import java.io.File;
import java.util.List;
import java.util.Random;

import com.swf.common.utils.FwsFileUtils;
import com.swf.common.utils.FwsIOUtils;
import com.swf.common.utils.FwsPatternUtils;

public class Payin {
	

	public static void main(String[] args) throws Exception {
		File out = new File("d:/932_55_01_20140518_040");
		out.delete();
		File in = new File("d:/openacco.txt");
		String content = FwsFileUtils.loadFile(in, "GBK");
		List<String> accoList = FwsPatternUtils.matchedList(content, ".+");
		FwsIOUtils io = new FwsIOUtils();
		io.setAppend(true);
		io.setOutFile(out);
		io.setCharst("GBK");
		Random r = new Random();
		io.setContent("0   00000000000100000");
		io.writeByline();
		for (int i=0;i<100000;i++){
			if (i%10000==0){
				System.out.println("finish "+i);
			}
			String line  =getOneLine(accoList.get(r.nextInt(10000)), ""+(1000000+i));
			io.setContent(line);
			io.writeByline();
		}
		io.setContent("END");
		io.writeByline();
	}
	
	
	
	public static String getOneLine(String acco,String tran_id){
		String s = "55  "+acco+"20140518"+tran_id+"                 104000600      0000000001000000015622014051822284500212002020220140519";
		//String s = "55  "+acco+"000600      2014051814342"+tran_id+"            110000000000000001001562014051823342320140518";
		//String s = "55  "+acco+"2014051814340"+tran_id+"            111000600      000000000000001002014051823340400212002020220140518";
		return s;
	}
}
